<?php

class CCacheGroup {
	var $groupName;
	public function __construct($groupName) {
		$this->groupName = 'group_'.$groupName;
	}
	
	public function addCache($cacheName) {
		$caches = CSystem::$cachelayout->get($this->groupName, array());
		$caches[$cacheName] = 1;
		CSystem::$cachelayout->put($this->groupName, $caches, 864000);
	}
	
	public function clearGroupCache() {
		$caches = CSystem::$cachelayout->get($this->groupName, array());
		foreach ($caches as $key=>$value) {
			CSystem::$cachelayout->delete($key);
		}
	}
};